<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); 

class Permission_model extends CI_Model
{
	
	var $location_table		= 'localtion';
	var $table				= 'user';
	var $groups_table		= 'user_group';
	
	/**
	 * Constructor
	 *
	 * @access	public
	 */
	function __construct()
	{
		parent::__construct();
	}
	
	// =============================
	// = ========== GET ========== =
	// =============================
		
	/**
	 * Get relevant user information by id
	 *
	 * @access	public
	 * @param	integer	User ID
	 */
	
	public function find_status_by($status = NULL, $active = NULL)
	{
		$this->db->select('*');
		$this->db->where($status,$active);
		$query = $this->db->get('permission');
		return $query->result_array();
		
	}
	
	public function find_for_role($roleid = NULL)
	{
		$this->db->select('*');
		$this->db->where('role_id',$roleid);
		$query = $this->db->get('role_permission');
		return $query->result_array();
		
	}
	

}


// END user_model.php
/* Location: ./application/models/users_model.php */
